<?php

namespace Desktopd\MUA;


// Base64 encoding
class Base64 extends Encoding {
    const PLAIN = false;
    const RFC2045 = true;
    const MIME = true;
    
    public static function encode ($plain, $mime = true) {
        $encoded = base64_encode("$plain");
        return new self($mime ? chunk_split($encoded) : $encoded);
    }
    
    public function decode () {
        return base64_decode($this->getEncoded());
    }
}


// vim: ts=4 et ai

